<template>
	<view class="no-data">
	    <!-- 1：默认图片 2:附件暂无停车场 3:我的车辆 4:爱心停车 5:优惠券 6:暂无网络 7:审核成功-->
	    <view class="no-empty" v-if="networkType == 1">
	        <image 
					class="no-image" 
					:style="{width:pdRpx(width)}" 
					mode="widthFix" 
					v-if="type == '1'" 
					:src="imgPath.home_noData_default_no" />
	        <image 
					class="no-image" 
					:style="{width:pdRpx(width)}" 
					mode="widthFix" v-if="type == '2'" 
					:src="imgPath.home_noData_address" />
	        <image class="no-image" 
					:style="{width:pdRpx(width)}" mode="widthFix" 
					v-if="type == '3'" :src="imgPath.home_noData_car" />
	        <image class="no-image" 
					:style="{width:pdRpx(width)}" mode="widthFix" 
					v-if="type == '4'" :src="imgPath.home_noData_aixin" />
	        <image class="no-image" 
					:style="{width:pdRpx(width)}" mode="widthFix" 
					v-if="type == '5'" :src="imgPath.home_noData_youhui" />
	        <image class="no-image" 
					:style="{width:pdRpx(width)}" mode="widthFix" 
					v-if="type == '7'" :src="imgPath.home_noData_success" />
					<image class="no-image"
					:style="{width:pdRpx(width)}" mode="widthFix" 
					v-if="type == '8'" src="/static/parking/aixinNodate.png" />
					<view class="tip" v-if="tips">
	            {{tips || ''}}
	        </view>
	        <slot></slot>
	    </view>
	    <view class="no-empty" v-else>
	        <image class="no-image" 
					:style="{width:pdRpx(width)}" mode="widthFix" 
					:src="imgPath.home_noData_no_wifi" />
	        <view class="tip" v-if="tips">
	            {{tips || ''}}
	        </view>
	        <slot></slot>
	    </view>
	</view>
</template>

<script>
	import  { imgPath } from '@/static/imgPath.js'
	export default {
		name:"noData",
		data() {
			return {
				imgPath,//图片地址
				carTipsShow: false,
				networkType: 1,//0无网络 1有网络
			};
		},
		props: {
			type: {//显示的类型
				type: [Number, String],
				default:()=>{
					return 1
				}
			},
			tips: {//提示语
				type: [String],
				default:()=>{
					return '暂无数据~'
				}
			},
			width: {//图片宽度
				type: [Number, String],
				default:()=>{
					return ''
				}
			},
		},
		methods:{
			pdRpx(e){
				return e.indexOf('rpx') == -1 ? (e.indexOf('%') == -1 ? e + 'rpx' : e) : e
			},
		}
	}
</script>

<style lang="less" scoped>
.no-data {
    width: 100%;
    padding: 136rpx 0 52rpx;
}

.no-empty {
    width: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    flex-direction: column;
}

.no-data .no-image {
    width: 100%;
    height: 100%;
    width: 358rpx;   
}

.no-data .tip {
    height: 46rpx;
    font-size: 32rpx;
    font-weight: 400;
    color: #333333;
    line-height: 46rpx;
    margin-top:54rpx;
}

</style>